import request from '@/axios'
import type { CurdData } from './types'

export const getEnumApi = (params: any) => {
  return request.get({ url: '/admin/customer/followRecords/resource', params })
}

export const getListApi = (params: any) => {
  return request.get({ url: '/admin/customer/followRecords', params })
}

export const getDetApi = (id: string): Promise<IResponse<CurdData>> => {
  return request.get({ url: '/admin/customerContact/' + id, params: { id } })
}

export const delDataApi = (data) => {
  return request.delete({ url: `/admin/customer/followRecords`, data })
}

export const createDataApi = (data) => {
  return request.post({ url: '/admin/customer/followRecords', data })
}

export const getOrderListApi = (params: any) => {
  return request.get({ url: '/admin/customer/followRecords/order', params })
}

export const getInfoApi = (id: string): Promise<IResponse<CurdData>> => {
  return request.get({ url: '/admin/customer/followRecords/' + id })
}

export const editDataApi = (data) => {
  return request.put({ url: `/admin/customer/followRecords`, data })
}
